package com.itlong.cloud.POJO.PO;

import com.itlong.cloud.annotation.ItlField;
import com.itlong.cloud.annotation.ItlTables;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <desc>
 *      App用户项目信息实体类。
 * </desc>
 * @createDate 2017/09/18
 */
@ItlTables("app_user_project")
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class AppUserProjectPO extends BasePO implements Serializable{
    @ItlField(value = "user_id")
    private String userId;      //用户ID
    @ItlField("project_id")
    private String projectId;   //小区编号
    @ItlField("project_type")
    private String projectType;        //用户小区类型：0自己居住 1周边小区
    @ItlField("card_num")
    private String cardNum;     //软卡号
    @ItlField("user_project_status")
    private String userProjectStatus;      //用户项目状态：0冻结 1启用
    @ItlField("sip_account")
    private String sipAccount;      //sip账号
    @ItlField("sip_psd")
    private String sipPsd;      //sip密码
    @ItlField("qq_num")
    private String qqNum;      //QQ号码
    @ItlField("tiny_id")
    private String tinyId;      //QQ号码
    @ItlField("qr_code")
    private String qrCode;      //二维码
    @ItlField("qr_code_end_time")
    private Date qrCodeEndTime;       //二维码生效过期时间
    @ItlField("id_cards")
    private String idCards;     //身份证号
    @ItlField("emergency_contact")
    private String emergencyContact;    //紧急联系人
    @ItlField("emergency_phone")
    private String emergencyPhone;      //紧急联系人电话
    @ItlField("is_allow_app")
    private Integer isAllowApp;     //默认0,0-是，1-否
    @ItlField("is_allow_phone")
    private Integer isAllowPhone;     //默认0,0-是，1-否
    @ItlField("user_type")
    private Integer userType;     //APP用户在项目中身份类型，默认1，1-普通用户，5-工程人员

    @ItlField("is_face")
    private Integer isFace;   //是否启用人脸 0-否 1-是

    @ItlField("card_id")
    private String cardId;  // 一卡通卡号

    @ItlField("face_pic_url")
    private String facePicUrl; //人脸头像链接

    @ItlField("face_create_time")
    private Date faceCreateTime;   //人脸图片创建时间

    @ItlField("remark")
    private String remark;      //备注

    @ItlField("arrearage_status")
    private String arrearageStatus;      //用户欠费状态, 0代表否, 1代表是

    @ItlField("common_floor")
    private String commonFloor;     // 用户常用楼层，json字符串，key为device_unique，value为natural_floor

    @ItlField("elevator_order")
    private String elevatorOrder;     // 用户电梯设备排序序列

    @ItlField("user_label")
    private String userLabel;  //用户标签，1-VIP，2-障碍人士，多个英文逗号连接

    @ItlField("elevator_controller_order")
    private String elevatorControllerOrder;  //用户电梯和群控器设备排序序列

    @ItlField("data_source")
    private Integer dataSource;     //数据来源 1app 2物业后台 为了限制app用户选择项目后直接展示在物业列表中，当为1时不展示在物业列表中

    public AppUserProjectPO(
            String userId, String projectId, String projectType,
            String userProjectStatus) {
        this.userId = userId;
        this.projectId = projectId;
        this.projectType = projectType;
        this.userProjectStatus = userProjectStatus;
    }

    /**
     *  <desc>
     *      APP端_首页版块，用户申请房屋认证
     *  </desc>
     * @param userId
     * @param projectId
     * @param projectType
     * @param cardNum  初始默认为000000
     * @param userProjectStatus
     * @param userType
     * @param status
     * @param createTime
     */
    public AppUserProjectPO(String userId,String projectId,String projectType,String cardNum,String userProjectStatus,Integer userType,Integer status,Date createTime){
        this.userId = userId;
        this.projectId = projectId;
        this.projectType = projectType;
        this.cardNum = cardNum;
        this.userProjectStatus = userProjectStatus;
        this.userType = userType;
        super.setStatus(status);
        super.setCreateTime(createTime);
    }

    /**
     * <desc>
     *     APP端_初始化用户与项目关系
     * </desc>
     * @param userId
     * @param projectId
     */
    public AppUserProjectPO(String userId,String projectId){
        this.userId = userId;
        this.projectId = projectId;
    }

}
